Conventionally, when a terminal displays a file, such as a PDF (Portable Document Format) file, on its display, an area for displaying a text portion may be small, since the PDF file has blank page margins which occupy a part of the display of the terminal. Thus, reading effect may be affected, especially when the terminal is a portable terminal with a small display, such as a smart phone, an MP3, an MP4 or an e-book reader. To enlarge the area for displaying the text portion of the PDF file, conventionally, the terminal detects the text portion on each page of the PDF file, verifies and corrects edges of the detected text portion, and cuts the blank page margins so as to display only the text portion of the page. In this way, the area for displaying the text portion is enlarged.
Since the blank page margins on respective pages of the PDF file may be different, the terminal generally needs to detect the display area on each page of the PDF file in real time according to an algorithm. In this case, a large amount of resources are consumed by the operation of trimming page margins of the PDF file. For example, because the computing resource of a mobile phone is generally limited, the process of trimming page margins of the whole PDF file runs slowly, and it generally takes several seconds to switch from displaying a current page to displaying a next page with page margin trimming, which is inefficient.